package com.toy.controller;


import com.toy.entity.OrderDetail;
import com.toy.mapper.OrderDetailMapper;
import com.toy.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author admin
 * @since 2022-08-31
 */
@RestController
@RequestMapping("/orders")
public class OrdersController {


    @Autowired
    private OrderDetailMapper orderDetailMapper;
    @PutMapping("/{id}")
    public SysResult updateStatus(@PathVariable String id){
        OrderDetail orderDetail = new OrderDetail();
        orderDetail.setId(Integer.parseInt(id));
        orderDetail.setStatus(3);
        orderDetailMapper.updateById(orderDetail);
        return SysResult.success();
    }

}

